/*
 * Copyright 2020 edenrun.cn All right reserved. This software is the
 * confidential and proprietary information ofedenrun.cn ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with edenrun.cn.
 */

package com.zoom.pluto.smart.controller;

import com.zoom.pluto.common.model.dto.Result;
import com.zoom.pluto.common.model.dto.SmartDTO;
import com.zoom.pluto.smart.service.impl.SmartServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 骨密度数据访问服务控制层
 *
 * @author zoom
 * @date 2020-07-06
 */
@CrossOrigin(origins = "*", allowedHeaders = "*", maxAge = 3600)
@RestController
@Api(value = "Zmart服务接口", tags = {"Zmart服务接口"})
public class SmartController {

    @Resource
    private SmartServiceImpl smartService;

    @ApiOperation(value = "根据身份证号取得病人所有心血管信息", httpMethod = "GET")
    @GetMapping(value = "/smart/query/idno/{idno}")
    public Result<SmartDTO> querySmartDetailByIdNo(@PathVariable String idno) {
        return Result.success(smartService.getLatestSmartInfo(idno));
    }

}
